<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
[#import "/admin/include/admin_pagination.ftl" as p/]
[#include "/admin/include/admin_static.htm"]
    <script type="text/javascript">
        layui.use(['form','layer'], function(){
            var form = layui.form(), $=layui.jquery, layer = layui.layer;
            form.on('switch(switch)', function(data){
                var index = layer.load();
                ajax({
                    url:"/admin/payment/modify.aspx",
                    data: {"id":data.elem.attributes['selectid'].value},
                    success: function(result){
                        layer.msg(result.content,{time:500}, function(){
                            location.href='${path}/admin/payment/list.aspx';
                        });
                        layer.close(index);
                    },
                    complete:function(){
                        layer.close(index);
                    },error:function(){
                        layer.close(index);
                    }
                });

            });
        });
    </script>
</head>
<body>
<div class="main_admin_content">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>支付方式</legend>
</fieldset>
    <a href="${path}/admin/payment/detail.aspx"   class="layui-btn "  style="width: 100px; heigth: 30px; line-height: 30px">添加</a>

    <form class="layui-form">

        <table class="layui-table">
            <colgroup>
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
                <col width="80">
            </colgroup>
            <thead>
            <tr>
                <th>支付类型</th>
                <th>支付名称</th>
                <th>支付详细</th>

                <th>开启/关闭</th>
                <th>修改</th>
            </tr>
            </thead>
            <tbody>
            [#list payments as payment]
            <form class="layui-form" action="">
            <tr>
                <td>

                ${p2p_get_dict("recharge_methods",payment.style )}

                </td>
                <td>${payment.name}</td>
                <td>${payment.description }</td>

                <td>

                    <input type="checkbox" name="isagree" selectid="${payment.id}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch"  value="1"
                        [#if payment.status==1]
                           checked="checked"
                    [#else]

                    [/#if]>

                </td>
                <td><input type="button" value="配置"  class="layui-btn " onclick="window.location.href='${path}/admin/payment/detail.aspx?id=${payment.id}'" class="btn_blue"/></td>
            </tr>
                </form>
            [/#list]

            </tbody>

        </table>


</div>

</body>
</html>